<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>个人中心</title>
		<link href="/static/lvshi_pc/css/person.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/swiper-bundle.min.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/animate.min.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/reset.min.css" rel="stylesheet" />
		<script src="/static/lvshi_pc/js/swiper-bundle.min.js"></script>
		<script src="/static/lvshi_pc/js/jquery.min.js"></script>
		<script src="/static/lvshi_pc/js/wow.min.js"></script>
		<script src="/static/lvshi_pc/js/changeWindow.js"></script>
		<script src="/static/layer/layer.js"></script>
		<script src="/static/global/js/global.js"></script>
		<script src="/static/elementUi/axios.min.js"></script>
		<script src="/static/elementUi/Api.js"></script>
	</head>
	<body>
		<header>
			{include file="public/header"}
		</header>
		<img src="/static/lvshi_pc/images/bannera_02.png" class="banner" alt="">
		
		<div class="benbox">
			<div class="wrap">
				<div class="bennei">
					<div class="jibox">
						<div class="jilan"></div>
						<div class="jititle">基本资料</div>
					</div>
					<form id="myForm">
						<div class="dangbox">
							<div class="toubox">
								<div class="dangtxt">当前头像</div>
								<div class="touyou">
									<img id="avatar_img" onclick="selectFile()" src="{$user.avatar ?? '/static/lvshi_pc/images/head_03.png'}" class="headpic" alt="">
									<div class="headtxt" onclick="selectFile()">
										点击修改头像
									</div>
									<input type="hidden" name="avatar" id="avatar_input" class="geput" value="{$user.avatar}">
									<input type="file" onchange="upload()" style="display: none" id="file" class="geput" >
								</div>
							</div>
							<div class="gebox">
								<div class="dangtxt">姓名</div>
								<input type="text" name="nick" class="geput" value="{$user.nick}">
							</div>
							<div class="gebox">
								<div class="dangtxt">性别</div>
								<select class="geput" name="sex">
									<option value="男" {if $user.sex="男"} selected{/if}>男</option>
									<option value="女" {if $user.sex="女"} selected{/if}>女</option>
								</select>
							</div>
							<div class="gebox">
								<div class="dangtxt">年龄</div>
								<input type="text" class="geput" name="age" value="{$user.age}">
							</div>
							
							<div class="gebox">
								<div class="dangtxt">手机号</div>
								<input type="text" class="geput" value="{$user.tel|strReplaceStar}">
								<!-- <div class="bang">绑定手机号</div> -->
							</div>
							<div class="gebox">
								<div class="dangtxt">企业全称</div>
								<input type="text" class="geput" name="company" value="{$user.company}">
							</div>
							<div class="gebox" style="border: none;">
								<div class="dangtxt">关于我们</div>
								<div class="bna">V2.3.0</div>
							</div>
							
							<div class="cunbox" onclick="doSave()">
								保存
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		
		
		<footer>
			{include file="public/footer"}
		</footer>
		<script type="text/javascript">
			function upload() {
				console.log()
				let form = new FormData()
				form.append('file',document.getElementById('file').files[0])
				Api.my('/api/common.common/upload',form).then(res=>{
					if (res.code == 1) {
						$("#avatar_img").attr('src',res.data.path)
						$("#avatar_input").val(res.data.path)
					} else {
						showErrMsg(res.msg)
					}
				})
			}
			function selectFile() {
				$("#file").click()
			}
			function doSave() {
				Api.my('/index/user/updateUser',$("#myForm").serialize()).then(res=>{
					if (res.code == 1) {
					
					} else {
						showErrMsg(res.msg)
					}
				})
			}
			var mySwiper = new Swiper('#lba', {
				// loop: true,
				autoplay: {
					delay:4000
				},
				navigation: {
					nextEl: ".swiper-button-next",
					prevEl: ".swiper-button-prev",
				},
				pagination: {
					el: '.swiper-pagination',
					clickable: true,
				}
			});
			var mySwiper = new Swiper('#lbb', {
				loop: true,
				autoplay: true,
				direction: "vertical",
			});
			var mySwiper = new Swiper('#lbc', {
				slidesPerView: 4,
				spaceBetween: 30,
				loop: true,
				autoplay: true,
				navigation: {
					nextEl: ".swiper-button-next",
					prevEl: ".swiper-button-prev",
				},
			});
			// wow效果启用
			new WOW().init();
		</script>
	</body>

</html>
